package com.lankystar.sos.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
 * 求救单
 * @author SYX
 *
 */
@Entity
@Table(name="sos_sosOrder")
public class SosOrder implements Serializable{

	private static final long serialVersionUID = 1L;
	
	/**
	 * id、求救状态（发起求救、响应求救、到达求救位置，正在施救、）、施救完成、时间戳
	 */
	private int sosId;
	private SosStatus sosStatus;
	private Date createTime;
	private User user;//用户-->求救单    一对多
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getSosId() {
		return sosId;
	}
	public void setSosId(int sosId) {
		this.sosId = sosId;
	}
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@ManyToOne
	@JoinColumn(name="sosStatus_Id")
	public SosStatus getSosStatus() {
		return sosStatus;
	}
	public void setSosStatus(SosStatus sosStatus) {
		this.sosStatus = sosStatus;
	}
	@ManyToOne
	@JoinColumn(name = "user_Id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	

}
